package com.example.lvsuo.service.impl;

import com.example.lvsuo.entity.vo.JcVo;
import com.example.lvsuo.service.IJcService;
import com.example.lvsuo.entity.Jc;
import com.example.lvsuo.mapper.JcMapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * <p>
 * 案件信息 服务实现类
 * </p>
 *
 * @author 心心念念
 * @since 2021-03-30
 */
@Service
@Transactional
public class JcServiceImpl extends ServiceImpl<JcMapper, Jc> implements IJcService {

    @Autowired
    JcMapper jm;

    @Override
    public PageInfo queryJc(JcVo j) {
        if(j.getPageNum()==null){
            j.setPageNum(1);
        }
        if(j.getPageSize()==null){
            j.setPageSize(5);
        }
        PageHelper.startPage(j.getPageNum(),j.getPageSize());
        return new PageInfo(jm.queryJc(j));
    }
}
